<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta name="viewport" content="width=device-width, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no"/>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>爱贝儿医</title>
    <link rel="stylesheet" href="../style/common.css?<?=版本?>">
</head>
<?php

/**
 * Created by PhpStorm. User: ADun, Date: 14-10-15 下午10:11
 * Description:
 */
$openId=getCurrentUserOID();

if(empty($openId)) exit('参数错误');

$bm = new CUI数据中心(Page::b病历管理,$openId);
$显示所有病例文章 = $bm->生成有效链接('Seller19BingliAS',$_GET['state']);
$添加所有病例文章 = $bm->生成有效链接('Seller19BingliAS_add',$_GET['state']);
$查看病例文章 = $bm->生成有效链接('Seller19BingliAS_show',$_GET['state']);


$搜索 = "";
if($_POST['标题']){
    $搜索['标题'] = $_POST['标题'];
}
$_GET['zt'] = $_GET['zt'] == "" ?"id":$_GET['zt'];
$病历文章 = $bm->fc查找所有病历文章($_GET['page'],$_GET,$搜索);
?>

<body>
<div class="header"><div class="header_logo"><img src="../style/logo_small.png" /><h1>病例</h1></div>
    <a href="<?= $添加所有病例文章?>"><input name="" type="button" value="发布病例" /></div></a>

<!--病例-首页-->
<div class="nav">
    <ul>
        <li <?php if(($_GET['zt']=='id'|| !isset($_GET['zt']))&& !isset($_GET['an'])) echo "class='cli'";?> ><a href="<?=$显示所有病例文章?>&zt=id">全部</a></li>
        <li <?php if($_GET['zt']=='添加时间') echo "class='cli'";?>><a href="<?=$显示所有病例文章?>&zt=添加时间">最新发布</a></li>
        <li <?php if($_GET['zt']=='评论次数') echo "class='cli'";?>><a href="<?=$显示所有病例文章?>&zt=评论次数">正在热议</a></li>
        <li <?php if($_GET['an']=='已回答') echo "class='cli'";?>><a href="<?=$显示所有病例文章?>&an=已回答">已讨论</a></li>
        <li <?php if($_GET['an']=='待回答') echo "class='cli'";?>><a href="<?=$显示所有病例文章?>&an=待回答">待讨论</a></li>
    </ul>
</div>
<div class="search">

    <form action="" method="post">
        <input name="标题" type="text" id="keyword" class="txt" value="  搜索病例关键词…" onFocus="if(value==defaultValue){value='';this.style.color='#000'}" onBlur="if(!value){value=defaultValue;this.style.color='#ccc'}" />
        <div class="btn_bg"><input class="btn" type="submit" value="&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"></div></div>

    </form>


<div class="case_list">

    <?php
    foreach($病历文章['result'] as  $key=>$value){ ?>
        <a href="<?= $查看病例文章.'&id='.$value['id']?>">
            <table>
                <tr>
                    <td width="90"><div class="img"><img style="width: 96%;padding: 3% 0;"  src="<?php if($value['头像'] !='没有图片' &&$value['头像'] !='') echo $value['头像']; else echo "../cache/card_img/top_index.jpg"; ?>"  /></div></td>
                    <td>
                        <p style=" color: #262626"><?=   $value['title']?></p>
                       <!-- <h2><?=  mb_substr($value['title'],0,15,'utf-8')?></h2>
                        <p style=" color: #262626"><?=   $value['关键词'] ?></p>-->
                        <p>
                        <div class="author"><?= $value['name']?></div>
                        <div class="mores">
                            <span class="reply"><?=$value['评论次数']?></span>
                             <span>|</span><span class="reply2"><?=  $value['浏览次数']?></span>
                            <span>|</span><span class="time"><?=  substr($value['添加时间'],5,5);?></span></div>
                        </p>
                    </td>
                </tr>
            </table>
        </a>


    <?php }?>


</div>
<?= $病历文章['show'] ?>
</body>
</html>
